<me:UIVV x:Class="WPFExcelReport.TVVLIEF"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                    xmlns:VVT="clr-namespace:WPFExcelReport;assembly=TVVTLIEF"  
                    xmlns:VP="clr-namespace:WPFExcelReport;assembly=TVVPACK"  
                    xmlns:WP="clr-namespace:WPFExcelReport;assembly=TWPACK"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"
                    xmlns:VKD="clr-namespace:WPFExcelReport;assembly=TVKADR"   
                    xmlns:VV20="clr-namespace:WPFExcelReport;assembly=TVVAVIS"  
                    xmlns:VL="clr-namespace:WPFExcelReport;assembly=TVERSART"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    IsAuto="True"
                    Loaded="Window_Loaded"
     >
    <me:UIVV.Resources>
        <CollectionViewSource  x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVV.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            
            <WrapPanel Visibility="{Binding IsAuto,ElementName=TV,Converter={StaticResource nbv}}"> 
                <Button Click="VK4VVCommand" Content="{Binding Source={Localization:Translate Word=从销售单}}" Height="20" Margin="5,0,0,0" Width="Auto" />
                <Button Click="KD4VVCommand" Content="{Binding Source={Localization:Translate Word=从客户}}" Height="20" Margin="5,0,0,0" Width="Auto" /> 
            </WrapPanel>
            <VP:TVVPACK  Visibility="Collapsed" />
            <WP:TWPACK Visibility="Collapsed" />
            <WrapPanel>  
                <Button Click="EditCommand" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"
                        Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                    </Button.Background>
                </Button>
                <Button Click="SaveCommand" Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                        Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                    </Button.Background>
                </Button>
                <Grid Visibility="{Binding IsEdit,Converter={StaticResource ResourceKey= nbv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=运输方式:}}"></TextBlock>
                    <TextBlock Grid.Column="1"  Text="{Binding VVVERSART}"  Width="60" />
                    <TextBlock Grid.Column="2"  Text="{Binding Source={Localization:Translate Word=承运人:}}"></TextBlock>
                    <TextBlock Grid.Column="3"  Text="{Binding VVSPED}"  Width="60" />
                </Grid>
                <VL:TSVL02  SART="{Binding SART,ElementName=TV}" 
                            KEY="{Binding VSPED,ElementName=TV}" 
                           ORDERNUM="{Binding VSPED,ElementName=TV}"
                            IsEdit="{Binding IsEdit,ElementName=TV}"
                            Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"/>
                <VV20:TVV20                         
                         ORDERNUM="{Binding VVIS,ElementName=TV}"
                         SART="{Binding SART,ElementName=TV}" 
                         VSPED="{Binding VSPED,ElementName=TV}" 
                         LIEFSCH="{Binding KEY,ElementName=TV}"  
                    />
            </WrapPanel>

            <WrapPanel>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=公司:}}"></TextBlock>
                <ex:TXT72   FontSize="14" MaxLength="40"
                        IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                        Text="{Binding VVANAME1,Converter={StaticResource gb2312}}"
                        HorizontalAlignment="Left"
                        Width="200"/>
                <ex:TXT72   FontSize="14" MaxLength="40"
                        IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                        Text="{Binding VVANAME2,Converter={StaticResource gb2312}}"
                        HorizontalAlignment="Left"
                        Width="200"/>
            </WrapPanel>
            <WrapPanel>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=地址:}}"></TextBlock>
                <ex:TXT72   FontSize="14" MaxLength="40"
                        IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                        Text="{Binding VVASTRASSE,Converter={StaticResource gb2312}}"
                        HorizontalAlignment="Left"
                        Width="200"/>
                <ex:TXT72 Grid.Column="0" FontSize="14"  MaxLength="40" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                              Text="{Binding VVASTRASSE2,Converter={StaticResource gb2312}}" 
                              Width="200"/>
            </WrapPanel>
            <WrapPanel>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=联系人:}}"></TextBlock>
                <ex:TXT72   FontSize="14" MaxLength="13"
                        IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                        Text="{Binding VVABZBEZ,Converter={StaticResource gb2312}}"
                        HorizontalAlignment="Left"
                        Width="160"/>
                <TextBlock  Text="{Binding Source={Localization:Translate Word=电话:}}"></TextBlock>
                <ex:TXT72 Grid.Column="0" FontSize="14"  MaxLength="40" 
                              IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                              Text="{Binding VVAORT,Converter={StaticResource gb2312}}" 
                              Width="200"/>
            </WrapPanel>
        </StackPanel>
    </Grid>
</me:UIVV> 
 
